<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>《系统工程》管理员后台管理</title>
	<link rel="stylesheet" type="text/css" href="../../css/bootstrap.min.css">
	<link rel="stylesheet" type="text/css" href="../../css/bootstrap-table.css">
	<style type="text/css">
		*{
			margin:0;
			padding:0;
		}
		html{
			width: 100%;
			position:relative;
			height: 100%;
		}
		li{
			list-style: none;
		}
		a,a:hover{
			text-decoration: none;
		}
		header{
			max-width: 100%;
			z-index: 99999;
		}
	    header img{
	    	width:80px;
			height:80px;
	    }
	    header ul li{
	    	margin:20px 20px;

	    }
		.biaoti{
			font-weight:bold;
			font-size: 18px;
			color:#403F3F;
		}
		.navbar{
			height:100%;
			width:15%;
			background:linear-gradient(to bottom, #F7F7F9,white);
			position: relative;
			border:none;
		}
		nav ul li{
			cursor: pointer;
			width:100%;
			padding:15px 40px;
			border-bottom:1px solid white;
		}
		main{
			position:absolute;
			left:15%;
		}
		header ul:after{
			content: " ";
			display:block;
			clear: both;

		}
		.main-content{
			width: 100%;
			height:100%;
			margin:10px auto;
		}

		#dataContent .btn-groups{
			margin:15px;
		}
		.onClick{
			background-color:#403F3F;
    		color:white;
		}
		#dataContent .bootstrap-table{
			margin-top:-60px;
			margin-left: 20px;
		}

		#sectionTab .bootstrap-table{
			margin-top:0px;
			margin-left: 20px;
		}
		#mp4file,#docfile{
			width:50%;
			display: inline-block;
		}
	</style>
</head>
<body>
	<header>
		<img src="../../image/xiaohui.jpg">
		<span class="biaoti">《系统工程》精品资源共享课</span>
		<ul class="pull-right navbar-nav">
			<li><a data-toggle="modal" data-target="#adminModal" onclick="initAdminInfo()">个人信息</a></li>
			<li><span id="user">您好！超级管理员</span></li>
			<li class="logout"><a href="../login.html">退出</a></li>
		</ul>
	</header>
	<div class="main-content">
		<nav class="navbar navbar-default pull-left">
			<ul class="nav" id="nav">
				<li class="onClick">用户管理</li>
				<li>留言板管理</li>
				<li>课程管理</li>
			</ul>
		</nav>
		<main id="dataContent" >
			<div id="userData">
				<ul class="nav nav-tabs">
					<li class="active"><a data-toggle="tab" href="#studentTab">学生管理</a></li>
					<li><a data-toggle="tab" href="#teacherTab">教师管理</a></li>
					<li><a data-toggle="tab" href="#userTab">登陆用户管理</a></li>
				</ul>
				<div class="tab-content">
					<div id="studentTab" class="tab-pane fade in active">
						<div class="btn-groups">
							<button type="button" class="btn btn-primary" onclick="add('student')" data-toggle="modal" data-target="#textModal">新增</button>
							<button type="button" class="btn btn-warning" onclick="del('student')">删除</button>
						</div>
						<table id="student_grid"></table>
					</div>
					<div id="teacherTab" class="tab-pane fade">
						<div class="btn-groups">
							<button type="button" class="btn btn-primary" onclick="add('teacher')" data-toggle="modal" data-target="#textModal">新增</button>
							<button type="button" class="btn btn-warning" onclick="del('teacher')">删除</button>
						</div>
						<table id="teacher_grid"></table>
					</div>
					<div id="userTab" class="tab-pane fade">
						<table id="user_grid"></table>
					</div>
				</div>
			</div>
			<div id="messageData">
				<div id="messageTab" >
					<div class="btn-groups">
						<button type="button" class="btn btn-warning" onclick="delMessage('message')">删除</button>
					</div>
					<table id="message_grid"></table>
				</div>
				<div id="commentTab">
					<div class="btn-groups hidden">
						<button type="button" class="btn btn-warning" onclick="delMessage('comment')">删除</button>
					</div>
					<table id="comment_grid"></table>
				</div>
				
			</div>
			<div id="sectionData">
				<div id="sectionTab">
					<table id="section_grid"></table>
				</div>
				<div id="videoTab">
					<div class="btn-groups hidden">
						<button type="button" class="btn btn-primary" onclick="addResource('video')" data-toggle="modal" data-target="#fileModal">新增</button>
						<button type="button" class="btn btn-warning" onclick="delResource('video')">删除</button>
						<h3 class="seName"></h3>
						<span class="seId hidden"></span>
					</div>
					<table id="video_grid"></table>
				</div>
				<div id="homeworkTab">
					<div class="btn-groups hidden">
						<button type="button" class="btn btn-primary" onclick="addResource('homework')" data-toggle="modal" data-target="#fileModal">新增</button>
						<button type="button" class="btn btn-warning" onclick="delResource('homework')">删除</button>
						<h3 class="seName"></h3>
						<span class="seId hidden"></span>
					</div>
					<table id="homework_grid"></table>
				</div>
				
			</div>
		</main>
	</div>
	<!-- 模态框（Modal） -->
	<div class="modal fade" id="textModal" tabindex="-1" role="dialog" aria-labelledby="textModalLabel" aria-hidden="true" data-backdrop="static">
	    <div class="modal-dialog">
	        <div class="modal-content">
	            <div class="modal-header">
	                <button type="button" class="close" data-dismiss="modal" aria-hidden="true" onclick="resetForm()">&times;</button>
	                <h4 class="modal-title" id="textModalLabel"></h4>
	            </div>
	            <div class="modal-body">
	            	<form role="form" name="userForm">
	            		<input type="text" name="id" class="form-control required hidden" />
						<input type="text" name="type" class="form-control required hidden" />
						<div class="form-group">
							<label for="name">用户名</label>
							<input type="text" name="name" class="form-control required " placeholder="一旦注册,不能修改" />
						</div>
						<div class="form-group">
							<label for="nickname">用户昵称</label>
							<input type="text" name="nickname" class="form-control required " />
						</div>
						<div class="form-group">
							<label for="password">密码</label>
							<input type="password" name="password" class="form-control required "/>
						</div>
						<div class="form-group">
							<label for="sex">性别</label>
							<select name="sex" class="form-control required">
								<option>男</option>
								<option>女</option>
							</select>
						</div>
						<div class="form-group">
							<label for="telphone">电话</label>
							<input type="text" name="tel" class="form-control required "/>
						</div>
						<div class="form-group">
							<label for="school">学校</label>
							<input type="text" name="school" class="form-control required "/>
						</div>		
						<div class="form-group">
							<label for="major">专业</label>
							<input type="text" name="major" class="form-control required "/>
						</div>
						<div class="form-group">
							<label for="major">学号</label>
							<input type="text" name="number" class="form-control required "/>
						</div>
						<div class="form-group">
							<label for="grade">年级</label>
							<select name="grade" class="form-control required">
							</select>
						</div>               		
	            	</form>
	            </div>
	            <div class="modal-footer">
	                <button type="button" class="btn btn-default" data-dismiss="modal" onclick="resetForm()">关闭</button>
	                <button type="button" class="btn btn-primary btn-submit" id="addSubmit" onclick="addSubmit()">提交更改</button>
	                <button type="button" class="btn btn-primary btn-submit" id="editSubmit" onclick="editSubmit()">提交更改</button>
	            </div>
	        </div><!-- /.modal-content -->
	    </div><!-- /.modal -->
	</div>
	<!-- 管理员个人信息修改 模态框 -->
	<div class="modal fade" id="adminModal" tabindex="-1" role="dialog" aria-labelledby="textModalLabel" aria-hidden="true" data-backdrop="static">
	    <div class="modal-dialog">
	        <div class="modal-content">
	            <div class="modal-header">
	                <button type="button" class="close" data-dismiss="modal" aria-hidden="true" onclick="resetForm()">&times;</button>
	                <h4 class="modal-title" id="adminModalLabel">管理员个人信息</h4>
	            </div>
	            <div class="modal-body">
	            	<form role="form" name="adminForm">
						<input type="text" name="id" class="form-control required hidden" />
						<div class="form-group">
							<label for="name">用户名</label>
							<input type="text" name="name" class="form-control required " />
						</div>
						<div class="form-group">
							<label for="password">原密码</label>
							<input type="password" name="oldPassword" class="form-control required "/>
						</div>
						<div class="form-group">
							<label for="password">新密码</label>
							<input type="password" name="newPassword" class="form-control required " disabled="true"/ >
						</div>
						<div class="form-group">
							<label for="telphone">电话</label>
							<input type="text" name="tel" class="form-control required "/>
						</div>
	            	</form>
	            </div>
	            <div class="modal-footer">
	                <button type="button" class="btn btn-default" data-dismiss="modal" onclick="resetForm()">关闭</button>
	                <button type="button" class="btn btn-primary btn-submit">提交更改</button>
	            </div>
	        </div><!-- /.modal-content -->
	    </div><!-- /.modal -->
	</div>
	<!-- 视频作业 模态框 -->
	<div class="modal fade" id="fileModal" tabindex="-1" role="dialog" aria-labelledby="fileModalLabel" aria-hidden="true" data-backdrop="static">
	    <div class="modal-dialog">
	        <div class="modal-content">
	            <div class="modal-header">
	                <button type="button" class="close" data-dismiss="modal" aria-hidden="true" onclick="resetForm()">&times;</button>
	                <h4 class="modal-title" id="fileModalLabel"></h4>
	            </div>
	            <div class="modal-body">
	            	<form role="form" name="adminForm" enctype="multipart/form-data">
	            		<input type="text" name="id" class="form-control required hidden">
						<input type="text" name="seId" class="form-control required hidden">
						<input type="text" name="type" class="form-control required hidden" />
						<div class="form-group hidden">
							<label for="file">当前文件  <span style="color:red">(如需更改请在下面文件中添加)</span></label>
							<input type="text" name="current" class="form-control required " disabled="true"/>
						</div>
						<div class="form-group hidden">
							<label for="file">视频文件</label>
							<input type="file" id="mp4file" name="mp4file" class="form-control required " accept="video/mp4"/>
							<button type="button" class="btn btn-primary btn-sm" onclick="upLoadFile('video')">上传</button>
							<span style="color:red">目前只支持MP4格式视频</span>
						</div>
						<div class="form-group hidden">
							<label for="file">作业文件</label>
							<input type="file" id="docfile" name="docfile" class="form-control required " accept="application/msword"/>
							<button type="button" class="btn btn-primary btn-sm" onclick="upLoadFile('homework')">上传</button>
							<span style="color:red">目前只支持doc格式作业</span>
						</div>
						<div class="form-group hidden">
							<label for="vSeq">视频顺序</label>
							<input type="number" name="vSeq" min="1" class="form-control required "/>
						</div>
	            	</form>
	            </div>
	            <div class="modal-footer">
	                <button type="button" class="btn btn-default" data-dismiss="modal" onclick="resetForm()">关闭</button>
	                <button type="button" class="btn btn-primary btn-submit hidden addSubmit" onclick="addResourceSubmit()">提交更改</button>
	                <button type="button" class="btn btn-primary btn-submit hidden editSubmit" onclick="editResourceSubmit()">提交更改</button>
	            </div>
	        </div><!-- /.modal-content -->
	    </div><!-- /.modal -->
	</div>
	<div class="modal fade" id="sectionModal" tabindex="-1" role="dialog" aria-labelledby="sectionModalLabel" aria-hidden="true" data-backdrop="static">
	    <div class="modal-dialog">
	        <div class="modal-content">
	            <div class="modal-header">
	                <button type="button" class="close" data-dismiss="modal" aria-hidden="true" onclick="resetForm()">&times;</button>
	                <h4 class="modal-title" id="sectionModalLabel">修改章节内容</h4>
	            </div>
	            <div class="modal-body">
	            	<form role="form" name="adminForm" enctype="multipart/form-data">
	            		<input type="text" name="seId" class="form-control hidden">
						<div class="form-group">
							<label for="seName">章节名称</label>
							<input type="text" name="seName" class="form-control required " />
						</div>
						<div class="form-group">
							<label for="seSeq">章节顺序</label>
							<input type="number" name="seSeq" class="form-control required " />
						</div>
						<div class="form-group">
							<label for="tId">上课老师</label>
							<select type="text" name="tId" class="form-control required "></select>
						</div>
						<div class="form-group">
							<label for="file">当前PPT  <span style="color:red">(如需更改请在下面文件中添加)</span></label>
							<input type="text" name="sePpt" class="form-control required " disabled="true" />
						</div>
						<div class="form-group">
							<label for="file">PPT</label>
							<input type="file" name="pptfile" class="form-control required " accept="application/vnd.ms-powerpoint" id="filePPT" />
						</div>
	            	</form>
	            </div>
	            <div class="modal-footer">
	                <button type="button" class="btn btn-default" data-dismiss="modal" onclick="resetForm()">关闭</button>
	                <button type="button" class="btn btn-primary btn-submit">提交更改</button>
	            </div>
	        </div><!-- /.modal-content -->
	    </div><!-- /.modal -->
	</div>
	<script type="text/javascript" src="../../js/jquery-3.2.1.min.js"></script>
	<script type="text/javascript" src="../../js/bootstrap.min.js"></script>
	<script type="text/javascript" src="../../js/bootstrap-table.js"></script>
	<script type="text/javascript" src="../../js/bootstrap-table-zh-CN.js"></script>
	<script type="text/javascript" src="js/adminIndex.js"></script>
	<script type="text/javascript" src="../../js/section.js"></script>
</body>
</html>